package com.neusoft.my12306.controller;


import com.neusoft.my12306.common.res.CommonResult;
import com.neusoft.my12306.entity.Roles;
import com.neusoft.my12306.service.IRolesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.management.relation.Role;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 段静迪
 * @since 2023-07-11
 */
@RestController
@RequestMapping("/r")
@CrossOrigin
public class RolesController {
    @Autowired
    IRolesService  rolesService;

    @PostMapping ("/auth")
    public   CommonResult  auth( String rid, String  sysids ){
        return  rolesService.auth(   rid,    sysids );
    }

    @PostMapping("/mod")
    public CommonResult modRoles(@RequestBody Roles  roles){
        System.out.println(roles.toString());
        return   rolesService.modRoles(roles);
    }


    @GetMapping("/q/all")
    public CommonResult  findAll(){
        return   rolesService.findAll();
    }
}
